src: fix crypto bio integer wraparound on 32 bits#1192
Merged
bnoordhuis merged 1 commit intonodejs:v1.xfrom Mar 18, 2015
Merged
src: fix crypto bio integer wraparound on 32 bits#1192bnoordhuis merged 1 commit intonodejs:v1.xfrom
bnoordhuis merged 1 commit intonodejs:v1.xfrom
Conversation
Member
|
Oh god, again. LGTM |
Fix a bug where a size_t was negated and passed to a function that takes an int64_t. It works by accident when sizeof(size_t) == sizeof(int64_t) but it causes the value to underflow when size_t is a 32 bits type. v8::Isolate::AdjustAmountOfExternalAllocatedMemory() is the function I'm talking about. The goal of that call is to tell V8 that some memory has been freed but due to that underflow, we were actually reporting that we had just allocated gigabytes of memory. It set off a garbage collector frenzy and essentially brought the VM to a standstill. Fixes: nodejs#1188 PR-URL: nodejs#1192 Reviewed-By: Fedor Indutny <fedor@indutny.com>
6aee810 to
fe0f015
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix a bug where a size_t was negated and passed to a function that takes
an int64_t. It works by accident when sizeof(size_t) == sizeof(int64_t)
but it causes the value to underflow when size_t is a 32 bits type.
v8::Isolate::AdjustAmountOfExternalAllocatedMemory() is the function I'm
talking about. The goal of that call is to tell V8 that some memory has
been freed but due to that underflow, we were actually reporting that we
had just allocated gigabytes of memory. It set off a garbage collector
frenzy and essentially brought the VM to a standstill.
Fixes: #1188
R=@indutny
/cc @Nibbler999 – can you confirm that the patch fixes your issue?
https://jenkins-iojs.nodesource.com/view/iojs/job/iojs+any-pr+multi/323/